#extractor <AnsiC.st.ext>

// 211 regulations:
primary_expression : 
    'identifier' // [0] [0]
  | 'constant' // [1] [1]
  | 'string_literal' // [2] [2]
  | '(' expression ')' ; // [3] [3]
postfix_expression : 
    primary_expression // [0] [4]
  | postfix_expression '[' expression ']' // [1] [5]
  | postfix_expression '(' ')' // [2] [6]
  | postfix_expression '(' argument_expression_list ')' // [3] [7]
  | postfix_expression '.' 'identifier' // [4] [8]
  | postfix_expression '->' 'identifier' // [5] [9]
  | postfix_expression '++' // [6] [10]
  | postfix_expression '--' ; // [7] [11]
argument_expression_list : 
    assignment_expression // [0] [12]
  | argument_expression_list ',' assignment_expression ; // [1] [13]
unary_expression : 
    postfix_expression // [0] [14]
  | '++' unary_expression // [1] [15]
  | '--' unary_expression // [2] [16]
  | unary_operator cast_expression // [3] [17]
  | 'sizeof' unary_expression // [4] [18]
  | 'sizeof' '(' type_name ')' ; // [5] [19]
unary_operator : 
    '&' // [0] [20]
  | '*' // [1] [21]
  | '+' // [2] [22]
  | '-' // [3] [23]
  | '~' // [4] [24]
  | '!' ; // [5] [25]
cast_expression : 
    unary_expression // [0] [26]
  | '(' type_name ')' cast_expression ; // [1] [27]
multiplicative_expression : 
    cast_expression // [0] [28]
  | multiplicative_expression '*' cast_expression // [1] [29]
  | multiplicative_expression '/' cast_expression // [2] [30]
  | multiplicative_expression '%' cast_expression ; // [3] [31]
additive_expression : 
    multiplicative_expression // [0] [32]
  | additive_expression '+' multiplicative_expression // [1] [33]
  | additive_expression '-' multiplicative_expression ; // [2] [34]
shift_expression : 
    additive_expression // [0] [35]
  | shift_expression '<<' additive_expression // [1] [36]
  | shift_expression '>>' additive_expression ; // [2] [37]
relational_expression : 
    shift_expression // [0] [38]
  | relational_expression '<' shift_expression // [1] [39]
  | relational_expression '>' shift_expression // [2] [40]
  | relational_expression '<=' shift_expression // [3] [41]
  | relational_expression '>=' shift_expression ; // [4] [42]
equality_expression : 
    relational_expression // [0] [43]
  | equality_expression '==' relational_expression // [1] [44]
  | equality_expression '!=' relational_expression ; // [2] [45]
and_expression : 
    equality_expression // [0] [46]
  | and_expression '&' equality_expression ; // [1] [47]
exclusive_or_expression : 
    and_expression // [0] [48]
  | exclusive_or_expression '^' and_expression ; // [1] [49]
inclusive_or_expression : 
    exclusive_or_expression // [0] [50]
  | inclusive_or_expression '|' exclusive_or_expression ; // [1] [51]
logical_and_expression : 
    inclusive_or_expression // [0] [52]
  | logical_and_expression '&&' inclusive_or_expression ; // [1] [53]
logical_or_expression : 
    logical_and_expression // [0] [54]
  | logical_or_expression '||' logical_and_expression ; // [1] [55]
conditional_expression : 
    logical_or_expression // [0] [56]
  | logical_or_expression '?' expression ':' conditional_expression ; // [1] [57]
assignment_expression : 
    conditional_expression // [0] [58]
  | unary_expression assignment_operator assignment_expression ; // [1] [59]
assignment_operator : 
    '=' // [0] [60]
  | '*=' // [1] [61]
  | '/=' // [2] [62]
  | '%=' // [3] [63]
  | '+=' // [4] [64]
  | '-=' // [5] [65]
  | '<<=' // [6] [66]
  | '>>=' // [7] [67]
  | '&=' // [8] [68]
  | '^=' // [9] [69]
  | '|=' ; // [10] [70]
expression : 
    assignment_expression // [0] [71]
  | expression ',' assignment_expression ; // [1] [72]
constant_expression : 
    conditional_expression ; // [0] [73]
declaration : 
    declaration_specifiers ';' // [0] [74]
  | declaration_specifiers init_declarator_list ';' ; // [1] [75]
declaration_specifiers : 
    storage_class_specifier // [0] [76]
  | storage_class_specifier declaration_specifiers // [1] [77]
  | type_specifier // [2] [78]
  | type_specifier declaration_specifiers // [3] [79]
  | type_qualifier // [4] [80]
  | type_qualifier declaration_specifiers ; // [5] [81]
init_declarator_list : 
    init_declarator // [0] [82]
  | init_declarator_list ',' init_declarator ; // [1] [83]
init_declarator : 
    declarator // [0] [84]
  | declarator '=' initializer ; // [1] [85]
storage_class_specifier : 
    'typedef' // [0] [86]
  | 'extern' // [1] [87]
  | 'static' // [2] [88]
  | 'auto' // [3] [89]
  | 'register' ; // [4] [90]
type_specifier : 
    'void' // [0] [91]
  | 'char' // [1] [92]
  | 'short' // [2] [93]
  | 'int' // [3] [94]
  | 'long' // [4] [95]
  | 'float' // [5] [96]
  | 'double' // [6] [97]
  | 'signed' // [7] [98]
  | 'unsigned' // [8] [99]
  | struct_or_union_specifier // [9] [100]
  | enum_specifier // [10] [101]
  | 'type_name' ; // [11] [102]
struct_or_union_specifier : 
    struct_or_union 'identifier' '{' struct_declaration_list '}' // [0] [103]
  | struct_or_union '{' struct_declaration_list '}' // [1] [104]
  | struct_or_union 'identifier' ; // [2] [105]
struct_or_union : 
    'struct' // [0] [106]
  | 'union' ; // [1] [107]
struct_declaration_list : 
    struct_declaration // [0] [108]
  | struct_declaration_list struct_declaration ; // [1] [109]
struct_declaration : 
    specifier_qualifier_list struct_declarator_list ';' ; // [0] [110]
specifier_qualifier_list : 
    type_specifier specifier_qualifier_list // [0] [111]
  | type_specifier // [1] [112]
  | type_qualifier specifier_qualifier_list // [2] [113]
  | type_qualifier ; // [3] [114]
struct_declarator_list : 
    struct_declarator // [0] [115]
  | struct_declarator_list ',' struct_declarator ; // [1] [116]
struct_declarator : 
    declarator // [0] [117]
  | ':' constant_expression // [1] [118]
  | declarator ':' constant_expression ; // [2] [119]
enum_specifier : 
    'enum' '{' enumerator_list '}' // [0] [120]
  | 'enum' 'identifier' '{' enumerator_list '}' // [1] [121]
  | 'enum' 'identifier' ; // [2] [122]
enumerator_list : 
    enumerator // [0] [123]
  | enumerator_list ',' enumerator ; // [1] [124]
enumerator : 
    'identifier' // [0] [125]
  | 'identifier' '=' constant_expression ; // [1] [126]
type_qualifier : 
    'const' // [0] [127]
  | 'volatile' ; // [1] [128]
declarator : 
    pointer direct_declarator // [0] [129]
  | direct_declarator ; // [1] [130]
direct_declarator : 
    'identifier' // [0] [131]
  | '(' declarator ')' // [1] [132]
  | direct_declarator '[' constant_expression ']' // [2] [133]
  | direct_declarator '[' ']' // [3] [134]
  | direct_declarator '(' parameter_type_list ')' // [4] [135]
  | direct_declarator '(' identifier_list ')' // [5] [136]
  | direct_declarator '(' ')' ; // [6] [137]
pointer : 
    '*' // [0] [138]
  | '*' type_qualifier_list // [1] [139]
  | '*' pointer // [2] [140]
  | '*' type_qualifier_list pointer ; // [3] [141]
type_qualifier_list : 
    type_qualifier // [0] [142]
  | type_qualifier_list type_qualifier ; // [1] [143]
parameter_type_list : 
    parameter_list // [0] [144]
  | parameter_list ',' '...' ; // [1] [145]
parameter_list : 
    parameter_declaration // [0] [146]
  | parameter_list ',' parameter_declaration ; // [1] [147]
parameter_declaration : 
    declaration_specifiers declarator // [0] [148]
  | declaration_specifiers abstract_declarator // [1] [149]
  | declaration_specifiers ; // [2] [150]
identifier_list : 
    'identifier' // [0] [151]
  | identifier_list ',' 'identifier' ; // [1] [152]
type_name : 
    specifier_qualifier_list // [0] [153]
  | specifier_qualifier_list abstract_declarator ; // [1] [154]
abstract_declarator : 
    pointer // [0] [155]
  | direct_abstract_declarator // [1] [156]
  | pointer direct_abstract_declarator ; // [2] [157]
direct_abstract_declarator : 
    '(' abstract_declarator ')' // [0] [158]
  | '[' ']' // [1] [159]
  | '[' constant_expression ']' // [2] [160]
  | direct_abstract_declarator '[' ']' // [3] [161]
  | direct_abstract_declarator '[' constant_expression ']' // [4] [162]
  | '(' ')' // [5] [163]
  | '(' parameter_type_list ')' // [6] [164]
  | direct_abstract_declarator '(' ')' // [7] [165]
  | direct_abstract_declarator '(' parameter_type_list ')' ; // [8] [166]
initializer : 
    assignment_expression // [0] [167]
  | '{' initializer_list '}' // [1] [168]
  | '{' initializer_list ',' '}' ; // [2] [169]
initializer_list : 
    initializer // [0] [170]
  | initializer_list ',' initializer ; // [1] [171]
statement : 
    labeled_statement // [0] [172]
  | compound_statement // [1] [173]
  | expression_statement // [2] [174]
  | selection_statement // [3] [175]
  | iteration_statement // [4] [176]
  | jump_statement ; // [5] [177]
labeled_statement : 
    'identifier' ':' statement // [0] [178]
  | 'case' constant_expression ':' statement // [1] [179]
  | 'default' ':' statement ; // [2] [180]
compound_statement : 
    '{' '}' // [0] [181]
  | '{' statement_list '}' // [1] [182]
  | '{' declaration_list '}' // [2] [183]
  | '{' declaration_list statement_list '}' ; // [3] [184]
declaration_list : 
    declaration // [0] [185]
  | declaration_list declaration ; // [1] [186]
statement_list : 
    statement // [0] [187]
  | statement_list statement ; // [1] [188]
expression_statement : 
    ';' // [0] [189]
  | expression ';' ; // [1] [190]
selection_statement : 
    'if' '(' expression ')' statement // [0] [191]
  | 'if' '(' expression ')' statement 'else' statement // [1] [192]
  | 'switch' '(' expression ')' statement ; // [2] [193]
iteration_statement : 
    'while' '(' expression ')' statement // [0] [194]
  | 'do' statement 'while' '(' expression ')' ';' // [1] [195]
  | 'for' '(' expression_statement expression_statement ')' statement // [2] [196]
  | 'for' '(' expression_statement expression_statement expression ')' statement ; // [3] [197]
jump_statement : 
    'goto' 'identifier' ';' // [0] [198]
  | 'continue' ';' // [1] [199]
  | 'break' ';' // [2] [200]
  | 'return' ';' // [3] [201]
  | 'return' expression ';' ; // [4] [202]
translation_unit : 
    external_declaration // [0] [203]
  | translation_unit external_declaration ; // [1] [204]
external_declaration : 
    function_definition // [0] [205]
  | declaration ; // [1] [206]
function_definition : 
    declaration_specifiers declarator declaration_list compound_statement // [0] [207]
  | declaration_specifiers declarator compound_statement // [1] [208]
  | declarator declaration_list compound_statement // [2] [209]
  | declarator compound_statement ; // [3] [210]

// 14 token statements:
%%<'struct'>[a-zA-Z_][a-zA-Z0-9_]*%% 'type_name' // [0]
%%[a-zA-Z_][a-zA-Z0-9_]*%% 'identifier' // [1]
%%0[xX][a-fA-F0-9]+(u|U|l|L)?%% 'constant' // [2]
%%0[0-9]+(u|U|l|L)?%% 'constant' // [3]
%%[0-9]+(u|U|l|L)?%% 'constant' // [4]
%%[a-zA-Z_]?'(\\.|[^\\'])+'%% 'constant' // [5]
%%[0-9]+[Ee][+-]?[0-9]+(f|F|l|L)?%% 'constant' // [6]
%%[0-9]*[.][0-9]+([Ee][+-]?[0-9]+)?(f|F|l|L)?%% 'constant' // [7]
%%[0-9]+[.][0-9]*([Ee][+-]?[0-9]+)?(f|F|l|L)?%% 'constant' // [8]
%%[a-zA-Z_]?"(\\.|[^\\"])*"%% 'string_literal' // [9]
%%([{]|[<]%)%% '{' // [10]
%%([}]|%>)%% '}' // [11]
%%([\[]|[<]:)%% '[' // [12]
%%([\]]|:>)%% ']' // [13]

// 0 precedences

// options
%grammarName AnsiC
%start translation_unit
%blockComment on
%inlineComment on
%validScopeChars [\u0001-\uFFFF]
%validGlobalChars [\u0001-\uFFFF]

